package com.billy.ohos.swipe.demo.consumer;


import com.billy.ohos.swipe.SmartSwipe;
import com.billy.ohos.swipe.SmartSwipeWrapper;
import com.billy.ohos.swipe.SwipeConsumer;
import com.billy.ohos.swipe.consumer.SpaceConsumer;
import com.billy.ohos.swipe.demo.BaseRecyclerViewAbility;
import com.billy.ohos.swipe.demo.ResourceTable;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Component;

/**
 * demo:
 * @author billy.qi
 */
public class SpaceConsumerAbility extends BaseRecyclerViewAbility {


    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        swipeConsumerView = SmartSwipe.wrapView(recyclerView).addConsumer(new SpaceConsumer()).enableVertical();

    }
    @Override
    public int getTitleResId() {
        return ResourceTable.String_demo_ui_SpaceConsumer;
    }

    @Override
    protected ViewHolder createRecyclerViewHolder(Component view) {
       itemConsumer =  SmartSwipe.wrapView(view).addConsumer(new SpaceConsumer()).enableHorizontal();
        return new ViewHolder(itemConsumer.getWrapper());
    }
}
